package com.rockcent.mall.lib.repository;

import com.rockcent.mall.lib.domain.MallFund;
import com.rockcent.mall.lib.domain.ProductQuantity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.stereotype.Repository;

import javax.persistence.LockModeType;

/**
 * Created by oyhk on 14-6-22.
 */
@Repository
public interface MallFundRepository extends JpaRepository<MallFund, Long>, JpaSpecificationExecutor {

    MallFund findByMallId(Long mallId);

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    MallFund findOne(Long id);

}